package cn.sh.yhk.oracle;

import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface TTeamSegMapper {
    @SelectProvider(type = TTeamSegSqlProvider.class, method = "countByExample")
    long countByExample(TTeamSegExample example);

    @DeleteProvider(type = TTeamSegSqlProvider.class, method = "deleteByExample")
    int deleteByExample(TTeamSegExample example);

    @Delete({
            "delete from T_TEAM_SEG",
            "where SEG_ID = #{segId,jdbcType=DECIMAL}"
    })
    int deleteByPrimaryKey(BigDecimal segId);

    @Insert({
            "insert into T_TEAM_SEG (SEG_ID, TEAM_ID, ",
            "SEGGROUP_ID, CREATE_DTM, ",
            "CREATE_ID, SEG_SQ, ",
            "DEP_CD, ARR_CD, DEP_DT, ",
            "ARR_DT, PLANETP, STOP, ",
            "SEG_TP, FARESOURCEID, ",
            "FARE_TP, FLIGHT_NO, ",
            "FLIGHT_GROUP_ID, REALFLIGHT, ",
            "ADT_FUEL_TAX, ADT_AIRPORT_TAX, ",
            "JINKUN_SEG_ID, FLIGHT_PLAN_ID, ",
            "JINKUN_LAN_ID, ASSEMBLED_TP, ",
            "SEG_CABIN, TRAVEL_TYPE, ",
            "DEP_TERM, ARRI_TERM)",
            "values (#{segId,jdbcType=DECIMAL}, #{teamId,jdbcType=DECIMAL}, ",
            "#{seggroupId,jdbcType=DECIMAL}, #{createDtm,jdbcType=DATE}, ",
            "#{createId,jdbcType=DECIMAL}, #{segSq,jdbcType=DECIMAL}, ",
            "#{depCd,jdbcType=VARCHAR}, #{arrCd,jdbcType=VARCHAR}, #{depDt,jdbcType=DATE}, ",
            "#{arrDt,jdbcType=DATE}, #{planetp,jdbcType=VARCHAR}, #{stop,jdbcType=DECIMAL}, ",
            "#{segTp,jdbcType=DECIMAL}, #{faresourceid,jdbcType=VARCHAR}, ",
            "#{fareTp,jdbcType=VARCHAR}, #{flightNo,jdbcType=VARCHAR}, ",
            "#{flightGroupId,jdbcType=DECIMAL}, #{realflight,jdbcType=VARCHAR}, ",
            "#{adtFuelTax,jdbcType=DECIMAL}, #{adtAirportTax,jdbcType=DECIMAL}, ",
            "#{jinkunSegId,jdbcType=VARCHAR}, #{flightPlanId,jdbcType=VARCHAR}, ",
            "#{jinkunLanId,jdbcType=VARCHAR}, #{assembledTp,jdbcType=OTHER}, ",
            "#{segCabin,jdbcType=VARCHAR}, #{travelType,jdbcType=VARCHAR}, ",
            "#{depTerm,jdbcType=VARCHAR}, #{arriTerm,jdbcType=VARCHAR})"
    })
    int insert(TTeamSeg record);

    @InsertProvider(type = TTeamSegSqlProvider.class, method = "insertSelective")
    int insertSelective(TTeamSeg record);

    @SelectProvider(type = TTeamSegSqlProvider.class, method = "selectByExample")
    @Results({
            @Result(column = "SEG_ID", property = "segId", jdbcType = JdbcType.DECIMAL, id = true),
            @Result(column = "TEAM_ID", property = "teamId", jdbcType = JdbcType.DECIMAL),
            @Result(column = "SEGGROUP_ID", property = "seggroupId", jdbcType = JdbcType.DECIMAL),
            @Result(column = "CREATE_DTM", property = "createDtm", jdbcType = JdbcType.DATE),
            @Result(column = "CREATE_ID", property = "createId", jdbcType = JdbcType.DECIMAL),
            @Result(column = "SEG_SQ", property = "segSq", jdbcType = JdbcType.DECIMAL),
            @Result(column = "DEP_CD", property = "depCd", jdbcType = JdbcType.VARCHAR),
            @Result(column = "ARR_CD", property = "arrCd", jdbcType = JdbcType.VARCHAR),
            @Result(column = "DEP_DT", property = "depDt", jdbcType = JdbcType.DATE),
            @Result(column = "ARR_DT", property = "arrDt", jdbcType = JdbcType.DATE),
            @Result(column = "PLANETP", property = "planetp", jdbcType = JdbcType.VARCHAR),
            @Result(column = "STOP", property = "stop", jdbcType = JdbcType.DECIMAL),
            @Result(column = "SEG_TP", property = "segTp", jdbcType = JdbcType.DECIMAL),
            @Result(column = "FARESOURCEID", property = "faresourceid", jdbcType = JdbcType.VARCHAR),
            @Result(column = "FARE_TP", property = "fareTp", jdbcType = JdbcType.VARCHAR),
            @Result(column = "FLIGHT_NO", property = "flightNo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "FLIGHT_GROUP_ID", property = "flightGroupId", jdbcType = JdbcType.DECIMAL),
            @Result(column = "REALFLIGHT", property = "realflight", jdbcType = JdbcType.VARCHAR),
            @Result(column = "ADT_FUEL_TAX", property = "adtFuelTax", jdbcType = JdbcType.DECIMAL),
            @Result(column = "ADT_AIRPORT_TAX", property = "adtAirportTax", jdbcType = JdbcType.DECIMAL),
            @Result(column = "JINKUN_SEG_ID", property = "jinkunSegId", jdbcType = JdbcType.VARCHAR),
            @Result(column = "FLIGHT_PLAN_ID", property = "flightPlanId", jdbcType = JdbcType.VARCHAR),
            @Result(column = "JINKUN_LAN_ID", property = "jinkunLanId", jdbcType = JdbcType.VARCHAR),
            @Result(column = "ASSEMBLED_TP", property = "assembledTp", jdbcType = JdbcType.OTHER),
            @Result(column = "SEG_CABIN", property = "segCabin", jdbcType = JdbcType.VARCHAR),
            @Result(column = "TRAVEL_TYPE", property = "travelType", jdbcType = JdbcType.VARCHAR),
            @Result(column = "DEP_TERM", property = "depTerm", jdbcType = JdbcType.VARCHAR),
            @Result(column = "ARRI_TERM", property = "arriTerm", jdbcType = JdbcType.VARCHAR)
    })
    List<TTeamSeg> selectByExample(TTeamSegExample example);

    @Select({
            "select",
            "SEG_ID, TEAM_ID, SEGGROUP_ID, CREATE_DTM, CREATE_ID, SEG_SQ, DEP_CD, ARR_CD, ",
            "DEP_DT, ARR_DT, PLANETP, STOP, SEG_TP, FARESOURCEID, FARE_TP, FLIGHT_NO, FLIGHT_GROUP_ID, ",
            "REALFLIGHT, ADT_FUEL_TAX, ADT_AIRPORT_TAX, JINKUN_SEG_ID, FLIGHT_PLAN_ID, JINKUN_LAN_ID, ",
            "ASSEMBLED_TP, SEG_CABIN, TRAVEL_TYPE, DEP_TERM, ARRI_TERM",
            "from T_TEAM_SEG",
            "where SEG_ID = #{segId,jdbcType=DECIMAL}"
    })
    @Results({
            @Result(column = "SEG_ID", property = "segId", jdbcType = JdbcType.DECIMAL, id = true),
            @Result(column = "TEAM_ID", property = "teamId", jdbcType = JdbcType.DECIMAL),
            @Result(column = "SEGGROUP_ID", property = "seggroupId", jdbcType = JdbcType.DECIMAL),
            @Result(column = "CREATE_DTM", property = "createDtm", jdbcType = JdbcType.DATE),
            @Result(column = "CREATE_ID", property = "createId", jdbcType = JdbcType.DECIMAL),
            @Result(column = "SEG_SQ", property = "segSq", jdbcType = JdbcType.DECIMAL),
            @Result(column = "DEP_CD", property = "depCd", jdbcType = JdbcType.VARCHAR),
            @Result(column = "ARR_CD", property = "arrCd", jdbcType = JdbcType.VARCHAR),
            @Result(column = "DEP_DT", property = "depDt", jdbcType = JdbcType.DATE),
            @Result(column = "ARR_DT", property = "arrDt", jdbcType = JdbcType.DATE),
            @Result(column = "PLANETP", property = "planetp", jdbcType = JdbcType.VARCHAR),
            @Result(column = "STOP", property = "stop", jdbcType = JdbcType.DECIMAL),
            @Result(column = "SEG_TP", property = "segTp", jdbcType = JdbcType.DECIMAL),
            @Result(column = "FARESOURCEID", property = "faresourceid", jdbcType = JdbcType.VARCHAR),
            @Result(column = "FARE_TP", property = "fareTp", jdbcType = JdbcType.VARCHAR),
            @Result(column = "FLIGHT_NO", property = "flightNo", jdbcType = JdbcType.VARCHAR),
            @Result(column = "FLIGHT_GROUP_ID", property = "flightGroupId", jdbcType = JdbcType.DECIMAL),
            @Result(column = "REALFLIGHT", property = "realflight", jdbcType = JdbcType.VARCHAR),
            @Result(column = "ADT_FUEL_TAX", property = "adtFuelTax", jdbcType = JdbcType.DECIMAL),
            @Result(column = "ADT_AIRPORT_TAX", property = "adtAirportTax", jdbcType = JdbcType.DECIMAL),
            @Result(column = "JINKUN_SEG_ID", property = "jinkunSegId", jdbcType = JdbcType.VARCHAR),
            @Result(column = "FLIGHT_PLAN_ID", property = "flightPlanId", jdbcType = JdbcType.VARCHAR),
            @Result(column = "JINKUN_LAN_ID", property = "jinkunLanId", jdbcType = JdbcType.VARCHAR),
            @Result(column = "ASSEMBLED_TP", property = "assembledTp", jdbcType = JdbcType.OTHER),
            @Result(column = "SEG_CABIN", property = "segCabin", jdbcType = JdbcType.VARCHAR),
            @Result(column = "TRAVEL_TYPE", property = "travelType", jdbcType = JdbcType.VARCHAR),
            @Result(column = "DEP_TERM", property = "depTerm", jdbcType = JdbcType.VARCHAR),
            @Result(column = "ARRI_TERM", property = "arriTerm", jdbcType = JdbcType.VARCHAR)
    })
    TTeamSeg selectByPrimaryKey(BigDecimal segId);

    @UpdateProvider(type = TTeamSegSqlProvider.class, method = "updateByExampleSelective")
    int updateByExampleSelective(@Param("record") TTeamSeg record, @Param("example") TTeamSegExample example);

    @UpdateProvider(type = TTeamSegSqlProvider.class, method = "updateByExample")
    int updateByExample(@Param("record") TTeamSeg record, @Param("example") TTeamSegExample example);

    @UpdateProvider(type = TTeamSegSqlProvider.class, method = "updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(TTeamSeg record);

    @Update({
            "update T_TEAM_SEG",
            "set TEAM_ID = #{teamId,jdbcType=DECIMAL},",
            "SEGGROUP_ID = #{seggroupId,jdbcType=DECIMAL},",
            "CREATE_DTM = #{createDtm,jdbcType=DATE},",
            "CREATE_ID = #{createId,jdbcType=DECIMAL},",
            "SEG_SQ = #{segSq,jdbcType=DECIMAL},",
            "DEP_CD = #{depCd,jdbcType=VARCHAR},",
            "ARR_CD = #{arrCd,jdbcType=VARCHAR},",
            "DEP_DT = #{depDt,jdbcType=DATE},",
            "ARR_DT = #{arrDt,jdbcType=DATE},",
            "PLANETP = #{planetp,jdbcType=VARCHAR},",
            "STOP = #{stop,jdbcType=DECIMAL},",
            "SEG_TP = #{segTp,jdbcType=DECIMAL},",
            "FARESOURCEID = #{faresourceid,jdbcType=VARCHAR},",
            "FARE_TP = #{fareTp,jdbcType=VARCHAR},",
            "FLIGHT_NO = #{flightNo,jdbcType=VARCHAR},",
            "FLIGHT_GROUP_ID = #{flightGroupId,jdbcType=DECIMAL},",
            "REALFLIGHT = #{realflight,jdbcType=VARCHAR},",
            "ADT_FUEL_TAX = #{adtFuelTax,jdbcType=DECIMAL},",
            "ADT_AIRPORT_TAX = #{adtAirportTax,jdbcType=DECIMAL},",
            "JINKUN_SEG_ID = #{jinkunSegId,jdbcType=VARCHAR},",
            "FLIGHT_PLAN_ID = #{flightPlanId,jdbcType=VARCHAR},",
            "JINKUN_LAN_ID = #{jinkunLanId,jdbcType=VARCHAR},",
            "ASSEMBLED_TP = #{assembledTp,jdbcType=OTHER},",
            "SEG_CABIN = #{segCabin,jdbcType=VARCHAR},",
            "TRAVEL_TYPE = #{travelType,jdbcType=VARCHAR},",
            "DEP_TERM = #{depTerm,jdbcType=VARCHAR},",
            "ARRI_TERM = #{arriTerm,jdbcType=VARCHAR}",
            "where SEG_ID = #{segId,jdbcType=DECIMAL}"
    })
    int updateByPrimaryKey(TTeamSeg record);
}